package AcWing练习题;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a
 * Date: 2022-08-22
 * Time: 10:31
 */
public class Demo_16 {
    public static String replaceSpaces(StringBuffer str) {
        String s = new String(str);
        return s.replaceAll(" ", "%20");
    }

    public static void main(String[] args) {
        System.out.println(replaceSpaces(new StringBuffer("We are happy")));
    }
}
